home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 8
/
Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso
/
Aminet
/
comm
/
fido
/
Rock_1_5.lha
/
ROCK
/
rock.wpl
< prev
next >
Wrap
Text File
|
1995-07-30
|
8KB
|
308 lines
;WPLSCRIPT rock
PRINT "Config Error! (main)\n"
RETURN
; Rock v1.5 - Fidonet mailer for point systems
; Copyright (C) 1995 Jean-Marc Xiume'.
; This software is distributed under the terms of the
; GNU General Public License. Read "license.doc" for more details.
; This file has been rewritten taking example from pop.wpl,
; copyright (c) 1994 Denis Turcotte.
;**************************** Main WPL script **************************
M:
SUBJUMP ROCKDEF!DISPLAY
SUBJUMP ROCKFIG!DISPLAY
SET cstatus "NOCLOSE"
SET wstatus "NOWAIT"
CMPI $(closestatus) FALSE
FALSEJUMP M1
SET cstatus "CLOSE"
SET wstatus "WAIT"
M1: SETSTATUS "$(status)/ROCK v1.5 - © 1994-1995 by Jean-Marc Xiume'/$(cstatus)/$(wstatus)/INACTIVE/SCREEN $(pubscreen)"
PRINT "ROCK mailer started\n"
SYSTEM "echo >>t:ROCK.log \"$<date> $<time> Started ROCK mailer v1.5"\"
SUBJUMP ROCKDEF!MODEM
SUBJUMP ROCKDEF!FILES
SUBJUMP ROCKFIG!FIDO
SUBJUMP ROCKFIG!MODEM
SUBJUMP ROCKFIG!FILES
PRINT "ROCK mailer configured\n\n"
SET stack 4096
SET serflags 164
SETBAUD $(baud)
SET starttime 0
SET callboss TRUE
SET X $(numbers)
AddResponse FIND "CONNECT "
AddResponse BUSY "BUSY"
AddResponse MAID "NO CARRIER"
AddResponse MAID "NO ANSWER"
AddResponse LINE "NO DIALTONE"
AddResponse 300 "CONNECT"
set mailername.0 "MelMail"
set mailername.5 "OPUS"
set mailername.7 "WPL based mailer"
set mailername.12 "FrontDoor"
set mailername.27 "Binkley"
set mailername.57 "TrapDoor"
set mailername.58 "Welmat"
set mailername.66 "TIMS"
set mailername.106 "MacWoof"
set mailername.170 "Xenolink"
SETA host $(host.address)
SET host.wzdomain $(host.domain).org host.freq FALSE host.wzcap 8
SET minsendpri 0 maxsendpri 127 initloop 8 initwait 3 owndevunit FALSE
SET postinbound ROCK!W postoutbound ROCK!X preinbound ROCK!Y preoutbound ROCK!Z
SYSTEM "execute rock:assignxferq $(outbound)xferq"
PRINT "Preparing to call ${rock_calling}\n"
CMPI ${rock_calling} "BOSS"
FALSEJUMP CA
REXXMSG "" REXX "ROCK:bossflo.rexx $(outbound)"
JUMP F
CA: REXXMSG "RY" REXX "ROCK:addrcheck.rexx ${rock_calling}"
CMP $(result2) 0
TRUEJUMP A
PRINT "Invalid address $(rock_calling)\n"
SYSTEM "echo >>t:ROCK.log \"$<date> $<time> Invalid address ${rock_calling}"\"
JUMP E0
A:
SET callboss FALSE
SET minbaud 0
SET numbers 1
SETA remote "${rock_calling}"
CLEAR remote.number remote.password
CMPI $(nodelist) FALSE
TRUEJUMP AM
PRINT "Searching nodelist...\n"
REXXMSG "RY" REXX "ROCK:nodelist.rexx ${rock_calling} $(nodelist)"
CMP $(result2) 1
TRUEJUMP AM
SET remote.number ${rock_phone}
SET remote.password ${rock_password}
PRINT "Phone $(remote.number)\n"
PRINT "Password $(remote.password)\n"
JUMP F
AM:
PRINT "\nPlease enter the phone number and the password of the called BBS\n"
REXXMSG "SY,RY" REXX "OPTIONS PROMPT 'Phone number: ';PARSE PULL x;RETURN x"
SET remote.number $(result2)
REXXMSG "SY,RY" REXX "OPTIONS PROMPT 'Password: ';PARSE PULL x;RETURN x"
SET remote.password $(result2)
F:
PRINT "\nSerial port speed:$(baud)bps - MinBaud:$(minbaud)bps\n"
I:
PRINT "Initializing Modem\n"
SET RC $<abort>
TRUEJUMP AB
MODEMOPEN
TRUEJUMP I1
PRINT "Cannot open device !\n"
SYSTEM "echo >>t:ROCK.log \"$<date> $<time> Failed opening modem device !"\"
JUMP ER
I1: MODEMINIT
TRUEJUMP I2
PRINT "Init failed!\n"
SYSTEM "echo >>t:ROCK.log \"$<date> $<time> Modem init failed !"\"
JUMP ER
I2: MODEMCLEAR
D1:
SET RC $<ABORT>
TRUEJUMP AB
CMPI $(callboss) TRUE
FALSEJUMP D2
REXXMSG "RY,SY" REXX "IF ($(X)+1)>$(numbers) THEN RETURN 1;ELSE RETURN $(X)+1"
SET X $(result2)
SETA remote $(boss.address$(X))
SET remote.number $(boss.number$(X))
D2: CMP $(remote.number) ""
FALSEJUMP D3
PRINT "No phone number\n"
JUMP ER
D3: PRINT "\nCalling $(remote.address) at $(remote.number)\n"
SYSTEM "echo >>t:ROCK.log \"$<date> $<time> Calling $(remote.address) at $(remote.number)"\"
SMARTSEND "$(dialstring)$(remote.number)|"
GETRESPONSE $(modemwait)
SET RC $<abort>
TRUEJUMP AB
;PRINT "Event: $(event)\n"
CMP $(event) CONNECT
TRUEJUMP C
CMP $(event) BUSY
TRUEJUMP BZ
CMP $(event) MAID
TRUEJUMP NC
CMP $(event) LINE
TRUEJUMP ND
CMP $(event) TIMEOUT
TRUEJUMP AB
JUMP ER
BZ: SYSTEM "echo >>t:ROCK.log \"$<date> $<time> BUSY"\"
DELAY $(calldelay)
JUMP D1
ND: SYSTEM "echo >>t:ROCK.log \"$<date> $<time> NO DIALTONE"\"
PRINT "Something is OUT OF ORDER! Will try again in 20 sec.\n"
DELAY 20
JUMP D1
NC: SYSTEM "echo >>t:ROCK.log \"$<date> $<time> NO CARRIER"\"
DELAY $(calldelay)
JUMP D1
C:
REXXMSG "RY,SY" REXX "IF $(baud)>=$(minbaud) THEN RETURN 1;ELSE RETURN 0"
SET RC $(result2)
TRUEJUMP CS
PRINT "Connection baudrate less than MinBaud, hanging up!\n"
SYSTEM "echo >>t:ROCK.log \"$<date> $<time> Connection at $(baud), MinBaud is $(minbaud), hanging up!"\"
MODEMCLOSE
DELAY $(calldelay)
JUMP I
CS: SET starttime $<time>
SYSTEM "echo >>t:ROCK.log \"$<date> $<time> CONNECT $(baud)"\"
BEGINSESSION $(remote.address)
GETOUTBOUND G6,D6
CMPI $(event) WAZOO
TRUEJUMP C1
SYSTEM "echo >>t:ROCK.log \"$<date> $<time> Failed Wazoo negotiation phase"\"
JUMP ER
C1: SYSTEM "echo >>t:ROCK.log \"$<date> $<time> Started Session with $(remote.address) - $(remote.sitename) - $(remote.sysop) - $(mailername.$(remote.product))"\"
PRINT "Started Session with $(remote.address) - $(remote.sitename) - $(remote.sysop) - $(mailername.$(remote.product))\n"
C2: CMP $(host.wzcap) 8
TRUEJUMP C3
SYSTEM "echo >>t:ROCK.log \"$<date> $<time> No common protocol available"\"
JUMP ER
C3: SETMAILERFLAGS DN,PN
XPRSETUP xprzedzap.library TN,OR,B16,F0,E30,AN,DN,KY,SN,RN,NY,M8192,C$(baud)
;XPRSETUP xprzedzap.library KN,C$(Baud)
CMP $(RC) 0
TRUEJUMP C4
SYSTEM "echo >>t:ROCK.log \"$<date> $<time> Error setting up xprzedzap.library"\"
JUMP ER
C4: CMPI $(callboss) TRUE
FALSEJUMP C5
REXXMSG "" REXX "ROCK:bossoutbound.rexx $(outbound) $(host.address) $(remote.address)"
C5: FINDFREQ $(remote.address)
REXXMSG "RY" REXX "ROCK:rock.rexx $(outbound) $(host.address) $(remote.address)"
CMP $(result2) 1
FALSEJUMP C6
SYSTEM "echo >>t:ROCK.log \"$<date> $<time> Site $(remote.address) not online"\"
C6: CMPI $(xprdisplay) TRUE
FALSEJUMP R
SETUPDATE "$(xprwin)/CONNECT $(baud) - $(remote.sitename) - $(remote.sysop)/INACTIVE/NOCLOSE/NOSIZE/SCREEN $(pubscreen)"
R: XPRSEND ""
FALSEJUMP L
SYSTEM "DELETE $(outbound)$(remote.zone).$(remote.net).$(remote.node).$(remote.point).?LO"
PRINT "Waiting for files\n"
DELAY 2
MODEMCLEAR
XPRRECEIVE ""
L: XPRCLOSE
SETUPDATE NULL
SYSTEM "echo >>t:ROCK.log \"$<date> $<time> Ended Session with $(remote.address)"\"
E: MODEMCLOSE
SET endtime $<time>
ENDSESSION ALL
CMPI $(starttime) 0
TRUEJUMP E0
REXXMSG "RY" REXX "ROCK:cnxtime.rexx $(starttime) $(endtime)"
SET dtime $(result2)
PRINT "Session connect time $(dtime)\n"
SYSTEM "echo >>t:ROCK.log \"$<date> $<time> Session connect time $(dtime)"\"
E0: PRINT "Exiting.\n"
SYSTEM "echo >>t:ROCK.log \"$<date> $<time> Exiting Rock."\"
CMPI $(logdisplay) FALSE
TRUEJUMP E1
SYSTEM "type T:rock.log >\"$(logwin)/SESSION LOG/INACTIVE/CLOSE/WAIT/SCREEN $(pubscreen)"\"
E1: CMPI $(logrock) FALSE
TRUEJUMP U
SYSTEM "echo >>t:ROCK.log \""\"
SYSTEM "type >>$(logfile) T:rock.log"
U: SYSTEM "DELETE >NIL: env:rock_calling env:rock_config env:rock_phone env:rock_password env:wplname xferq:#? T:rock.log"
SYSTEM "Assign XFERQ: remove"
DELAY 3
SET RC 1
RETURN
ER:
SYSTEM "echo >>t:ROCK.log \"$<date> $<time> An error has occured."\"
JUMP E
AB:
SYSTEM "echo >>t:ROCK.log \"$<date> $<time> Session aborted."\"
JUMP E
Y: RETURN
W: SYSTEM "echo >>t:rock.log \"$<date> $<time> $(filestatus) $(remfile) $(filesize) Bytes CPS:$(cps) ($(cpsp)%)"\"
PRINT "$(filestatus) $(remfile) $(filesize) Bytes CPS:$(cps) ($(cpsp)%)\n\n"
RETURN
Z: RETURN
X: SYSTEM "echo >>t:ROCK.log \"$<date> $<time> $(filestatus) $(remfile) $(filesize) Bytes CPS:$(cps) ($(cpsp)%)"\"
PRINT "$(filestatus) $(remfile) $(filesize) Bytes CPS:$(cps) ($(cpsp)%)\n\n"
RETURN
STARTUP:
;setstatus "kcon:0/130/640/250/ROCK v1.5 - © 1994-1995 by Jean-Marc Xiume'/WAIT/CLOSE"
LOADSCRIPT ROCKDEF rock:rock.default_cfg
FALSERETURN
LOADSCRIPT ROCKFIG ${rock_config}
FALSERETURN
LAUNCH ROCK ROCK!M 4 30000
RETURN